Public Class frmLANJoin
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
  Friend WithEvents lblIP As System.Windows.Forms.Label
  Friend WithEvents lbldot As System.Windows.Forms.Label
  Friend WithEvents Label1 As System.Windows.Forms.Label
  Friend WithEvents Label2 As System.Windows.Forms.Label
  Friend WithEvents lblPort As System.Windows.Forms.Label
  Friend WithEvents ntxtPort As System.Windows.Forms.NumericUpDown
  Friend WithEvents ntxtIP4 As System.Windows.Forms.NumericUpDown
  Friend WithEvents ntxtIP1 As System.Windows.Forms.NumericUpDown
  Friend WithEvents ntxtIP2 As System.Windows.Forms.NumericUpDown
  Friend WithEvents nTxtIP3 As System.Windows.Forms.NumericUpDown
  Friend WithEvents btnCancel As System.Windows.Forms.Button
  Friend WithEvents btnAccept As System.Windows.Forms.Button
  <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.lblIP = New System.Windows.Forms.Label
    Me.ntxtIP4 = New System.Windows.Forms.NumericUpDown
    Me.ntxtIP1 = New System.Windows.Forms.NumericUpDown
    Me.ntxtIP2 = New System.Windows.Forms.NumericUpDown
    Me.nTxtIP3 = New System.Windows.Forms.NumericUpDown
    Me.lbldot = New System.Windows.Forms.Label
    Me.Label1 = New System.Windows.Forms.Label
    Me.Label2 = New System.Windows.Forms.Label
    Me.lblPort = New System.Windows.Forms.Label
    Me.ntxtPort = New System.Windows.Forms.NumericUpDown
    Me.btnCancel = New System.Windows.Forms.Button
    Me.btnAccept = New System.Windows.Forms.Button
    CType(Me.ntxtIP4, System.ComponentModel.ISupportInitialize).BeginInit()
    CType(Me.ntxtIP1, System.ComponentModel.ISupportInitialize).BeginInit()
    CType(Me.ntxtIP2, System.ComponentModel.ISupportInitialize).BeginInit()
    CType(Me.nTxtIP3, System.ComponentModel.ISupportInitialize).BeginInit()
    CType(Me.ntxtPort, System.ComponentModel.ISupportInitialize).BeginInit()
    Me.SuspendLayout()
    '
    'lblIP
    '
    Me.lblIP.AutoSize = True
    Me.lblIP.Location = New System.Drawing.Point(21, 25)
    Me.lblIP.Name = "lblIP"
    Me.lblIP.Size = New System.Drawing.Size(86, 16)
    Me.lblIP.TabIndex = 0
    Me.lblIP.Text = "Host IP Address"
    '
    'ntxtIP4
    '
    Me.ntxtIP4.Location = New System.Drawing.Point(301, 20)
    Me.ntxtIP4.Maximum = New Decimal(New Integer() {254, 0, 0, 0})
    Me.ntxtIP4.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
    Me.ntxtIP4.Name = "ntxtIP4"
    Me.ntxtIP4.Size = New System.Drawing.Size(48, 20)
    Me.ntxtIP4.TabIndex = 1
    Me.ntxtIP4.Value = New Decimal(New Integer() {1, 0, 0, 0})
    '
    'ntxtIP1
    '
    Me.ntxtIP1.Location = New System.Drawing.Point(133, 20)
    Me.ntxtIP1.Maximum = New Decimal(New Integer() {254, 0, 0, 0})
    Me.ntxtIP1.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
    Me.ntxtIP1.Name = "ntxtIP1"
    Me.ntxtIP1.Size = New System.Drawing.Size(48, 20)
    Me.ntxtIP1.TabIndex = 2
    Me.ntxtIP1.Value = New Decimal(New Integer() {192, 0, 0, 0})
    '
    'ntxtIP2
    '
    Me.ntxtIP2.Location = New System.Drawing.Point(189, 20)
    Me.ntxtIP2.Maximum = New Decimal(New Integer() {254, 0, 0, 0})
    Me.ntxtIP2.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
    Me.ntxtIP2.Name = "ntxtIP2"
    Me.ntxtIP2.Size = New System.Drawing.Size(48, 20)
    Me.ntxtIP2.TabIndex = 3
    Me.ntxtIP2.Value = New Decimal(New Integer() {168, 0, 0, 0})
    '
    'nTxtIP3
    '
    Me.nTxtIP3.Location = New System.Drawing.Point(245, 20)
    Me.nTxtIP3.Maximum = New Decimal(New Integer() {254, 0, 0, 0})
    Me.nTxtIP3.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
    Me.nTxtIP3.Name = "nTxtIP3"
    Me.nTxtIP3.Size = New System.Drawing.Size(48, 20)
    Me.nTxtIP3.TabIndex = 4
    Me.nTxtIP3.Value = New Decimal(New Integer() {1, 0, 0, 0})
    '
    'lbldot
    '
    Me.lbldot.AutoSize = True
    Me.lbldot.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.lbldot.Location = New System.Drawing.Point(181, 24)
    Me.lbldot.Name = "lbldot"
    Me.lbldot.Size = New System.Drawing.Size(8, 16)
    Me.lbldot.TabIndex = 5
    Me.lbldot.Text = "."
    '
    'Label1
    '
    Me.Label1.AutoSize = True
    Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.Label1.Location = New System.Drawing.Point(237, 24)
    Me.Label1.Name = "Label1"
    Me.Label1.Size = New System.Drawing.Size(8, 16)
    Me.Label1.TabIndex = 6
    Me.Label1.Text = "."
    '
    'Label2
    '
    Me.Label2.AutoSize = True
    Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.Label2.Location = New System.Drawing.Point(292, 24)
    Me.Label2.Name = "Label2"
    Me.Label2.Size = New System.Drawing.Size(8, 16)
    Me.Label2.TabIndex = 7
    Me.Label2.Text = "."
    '
    'lblPort
    '
    Me.lblPort.AutoSize = True
    Me.lblPort.Location = New System.Drawing.Point(21, 52)
    Me.lblPort.Name = "lblPort"
    Me.lblPort.Size = New System.Drawing.Size(46, 16)
    Me.lblPort.TabIndex = 8
    Me.lblPort.Text = "Port No."
    '
    'ntxtPort
    '
    Me.ntxtPort.Location = New System.Drawing.Point(133, 47)
    Me.ntxtPort.Maximum = New Decimal(New Integer() {60000, 0, 0, 0})
    Me.ntxtPort.Minimum = New Decimal(New Integer() {1000, 0, 0, 0})
    Me.ntxtPort.Name = "ntxtPort"
    Me.ntxtPort.Size = New System.Drawing.Size(72, 20)
    Me.ntxtPort.TabIndex = 9
    Me.ntxtPort.Value = New Decimal(New Integer() {1000, 0, 0, 0})
    '
    'btnCancel
    '
    Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
    Me.btnCancel.Location = New System.Drawing.Point(61, 92)
    Me.btnCancel.Name = "btnCancel"
    Me.btnCancel.TabIndex = 10
    Me.btnCancel.Text = "Cancel"
    '
    'btnAccept
    '
    Me.btnAccept.Location = New System.Drawing.Point(221, 92)
    Me.btnAccept.Name = "btnAccept"
    Me.btnAccept.TabIndex = 11
    Me.btnAccept.Text = "Join"
    '
    'frmLANJoin
    '
    Me.AcceptButton = Me.btnAccept
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
    Me.CancelButton = Me.btnCancel
    Me.ClientSize = New System.Drawing.Size(370, 135)
    Me.ControlBox = False
    Me.Controls.Add(Me.btnAccept)
    Me.Controls.Add(Me.btnCancel)
    Me.Controls.Add(Me.ntxtPort)
    Me.Controls.Add(Me.lblPort)
    Me.Controls.Add(Me.Label2)
    Me.Controls.Add(Me.Label1)
    Me.Controls.Add(Me.lbldot)
    Me.Controls.Add(Me.nTxtIP3)
    Me.Controls.Add(Me.ntxtIP2)
    Me.Controls.Add(Me.ntxtIP1)
    Me.Controls.Add(Me.ntxtIP4)
    Me.Controls.Add(Me.lblIP)
    Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
    Me.Name = "frmLANJoin"
    Me.ShowInTaskbar = False
    Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
    Me.Text = "vsChessMania Join LAN Game"
    CType(Me.ntxtIP4, System.ComponentModel.ISupportInitialize).EndInit()
    CType(Me.ntxtIP1, System.ComponentModel.ISupportInitialize).EndInit()
    CType(Me.ntxtIP2, System.ComponentModel.ISupportInitialize).EndInit()
    CType(Me.nTxtIP3, System.ComponentModel.ISupportInitialize).EndInit()
    CType(Me.ntxtPort, System.ComponentModel.ISupportInitialize).EndInit()
    Me.ResumeLayout(False)

  End Sub

#End Region

  Dim _Port As Integer
  Dim _IPAddr As String

  Public ReadOnly Property IPAddr() As String
    Get
      Return _IPAddr
    End Get
  End Property

  Public ReadOnly Property IPPort() As Integer
    Get
      Return _Port
    End Get
  End Property

  Private Sub btnAccept_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAccept.Click
    _IPAddr = ntxtIP1.Value.ToString + "." + ntxtIP2.Value.ToString + "." + nTxtIP3.Value.ToString + "." + ntxtIP4.Value.ToString
    _Port = CInt(ntxtPort.Value)
    Me.DialogResult = Windows.Forms.DialogResult.OK
    Me.Hide()
  End Sub

  Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
    _IPAddr = "0.0.0.0"
    _Port = 1000
    Me.DialogResult = Windows.Forms.DialogResult.Cancel
    Me.Hide()
  End Sub
End Class
